Public Class FormOverwriteFiles

    'Constructor
    Public Sub New(ByVal data As COverwriteFiles, ByVal storedProcs As Boolean)
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        _data = data

        chkInsert.Enabled = storedProcs
        chkUpdate.Enabled = storedProcs
        chkSelectAll.Enabled = storedProcs
        chkSelectSingle.Enabled = storedProcs
        chkDelete.Enabled = storedProcs

        chkInsert.Checked = storedProcs
        chkUpdate.Checked = storedProcs
        chkSelectAll.Checked = storedProcs
        chkSelectSingle.Checked = storedProcs
        chkDelete.Checked = storedProcs
    End Sub

    'Members
    Private _data As COverwriteFiles

    'Event-Handlers
    Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
        With _data
            .AutoGenerated = chkAutoGenerated.Checked
            .Customizable = chkCustomisable.Checked

            .SpDelete = chkDelete.Checked
            .SpInsert = chkInsert.Checked
            .SpSelectAll = chkSelectAll.Checked
            .SpSelectSingle = chkSelectSingle.Checked
            .SpUpdate = chkUpdate.Checked
        End With

        me.Close()
    End Sub
    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Close()
    End Sub

End Class